class student {
    //成员变量
    public String name;
    public int age;
    public String gender;

    //成员方法
    public void toClass() {
        System.out.println("上课...");
    }

    public void eat() {
        System.out.println("吃饭...");
    }

    //构造方法
    public student() {
        System.out.println("无参构造方法");
    }

    public student(String name, int age, String gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;

    }

    public void print() {
        System.out.println(this.name+this.age+this.gender);
    }
}


public class Test {

    public static void main(String[] args) {
        student stu1 = new student();
        stu1.name = "张三";
        stu1.age = 30;
        stu1.gender = "男";
        stu1.print();

        student stu2 = new student("李四", 20, "男");
        stu2.print();
    }
}
